package com.miya.exception;

import lombok.Data;

/**
 * 业务异常
 *
 * @author Caixiaowei
 * @date 2022/02/11
 */
@Data
public class BusinessException extends RuntimeException{

    /**
     * 状态码
     */
    private int errorCode;

    /**
     * 错误信息
     */
    private String message;

    /**
     * 业务参数
     */
    private Object[] args;

    public BusinessException(int errorCode, String message) {
        this.errorCode = errorCode;
        this.message = message;
    }
    public BusinessException(String message) {
        this.errorCode = 500;
        this.message = message;
    }

}
